<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo CHtml::encode($this->pageTitle); ?></title>
<meta name="keywords" content="<?php echo CHtml::encode($this->pageKeyword); ?>" />
<meta name="description" content="<?php echo CHtml::encode($this->pageDesc); ?>">
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/style/style_one.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
<!--[if ie 6]>
<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/css/style/ie6.css">
<![endif]-->
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/MSClass.js"></script>
</head>
<body>
<!--顶部start-->
<div class="site_topbar">
	<div class="w_990 o_a">
    	<div class="left f_l"><a href="javascript:" title=""><b class="ico ico_collect"></b>收藏本站</a><span class="welcome">您好<?php if(user()->getName() !='Guest'){echo user()->getName();} ?>， 欢迎来到<?php echo F::setting('sitename') ?>！</span></div>
        <div class="right f_r">
        	<ul id="head_menu">
                <?php if (Yii::app()->user->isGuest){ ?>
            	<li class="item"><?php echo CHtml::link('登录','/home/user/login');?></li>
                <li class="item"><?php echo CHtml::link('免费注册','/home/user/registerone');?></li>
                <?php }else{ ?>
                <?php if (isset(Yii::app()->user->memgroup)) { //判断一个用户是否是买家会员?>
                		<li class="item"><?php echo CHtml::link('会员中心','/member/index');?></li>
                	<?php }?>
                	<?php if (isset(Yii::app()->user->comgroup)) { //判断一个用户是否是商家用户?>
	                    <li class="item"><?php echo CHtml::link('商家中心','/company/index');?></li>
	                <?php }?>
                <li class="item"><?php echo CHtml::link('退出','/home/user/logout');?></li>
                <?php } ?>
                <li class="item menu cart">
                	<a class="link" href="/cart/" title=""><b class="ico ico_cart"></b>购物车 <strong id="cart_num" onload="cartNum"></strong> 件<b class="ico ico_updown"></b></a>
                   <div class="sub_menu hide" id="cart-form">
                        <?php $this->renderPartial('//layouts/_cart'); ?>
                    </div>
                </li>
                <li class="item menu my_account">
                	<?php echo CHtml::link('我的帐户<b class="ico ico_updown"></b>','/member/index',array('class'=>'link'));?>
                   <ul class="sub_menu hide line_22">
                        <?php (isset(Yii::app()->user->userid))?$statusAmount = Order::model()->getOrderAmountOfStatus(Yii::app()->user->userid,1):$statusAmount["notpay"] = 0;?>
                        <li><?php echo CHtml::link('已买到的宝贝','/member/index/orders');?></li>
                        <li><?php echo CHtml::link('待付款宝贝('.$statusAmount["notpay"].')','/member/index/orders');?></li>
                        <li><?php echo CHtml::link('系统消息('.MsgLog::model()->getMsgLogNum().')','/member/msgLog/admin');?></li>
                    </ul>
                </li>
                <li class="item menu site_map">
                	<a class="link" href="javascript:" title="">网站导航<b class="ico ico_updown"></b></a>
                    <ul class="sub_menu hide line_22">
                    	<li><?php echo CHtml::link('首页','/');?></li>
                        <li><?php echo CHtml::link('团购',array('/home/tuan/index'))?></li>
                        <li><?php echo CHtml::link('促销专区',array('/home/discount/index'))?></li>
                        <li><?php echo CHtml::link('限时抢购',array('/home/promotion/index'))?></li>
                        <li><?php echo CHtml::link('资讯中心','/home/news/');?></li>
                        <li><?php echo CHtml::link('服务中心','/home/help/');?></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
</div>
<!--顶部end-->
<!--头部start-->
<div class="header">
	<div class="w_990 o_a">
    	<h1 class="logo f_l">
            <?php echo l(CHtml::image(F::setting('sitelogo'),app()->name),app()->homeUrl,array('title'=>app()->name))?>
        </h1>
        <div class="search_bar c_f">
            <form method="get" name="" id="" action="/home/product/search/" target="_blank">
            <div class="select"><select style="display:none;" name="type" id="headSearch"><option selected="selected" value="0">找产品</option><option value="1">找资讯</option></select></div>
            <input name="keyword" type="text" class="t_ipt" onblur="if(this.value==''){this.value='请输入搜索关键字';this.style.color='#bebebe'}" onfocus="if(this.value=='请输入搜索关键字'){this.value='';this.style.color='#333'}" value="请输入搜索关键字" /><button type="submit" class="btn_srh">搜索</button>
            </form>
        </div>
    </div>
</div>
<!--头部end-->
<div class="hr_15"></div>
<!--正文start-->
<div class="w_990 o_a cart">
	<?php echo $content; ?>	
</div>
<!--产品层 end-->
<!--正文end-->
<div class="hr_25"></div>
<!--底部start-->
<div class="footer">	
    <?php echo Block::model()->Getpos('index_foot_nav2')?>
</div>
<!--底部end-->
<script type="text/javascript" src="/js/common.js"></script>
<script type="text/javascript" src="/js/select.jQuery.js"></script>
<script type="text/javascript" src="/js/LoadImage.js"></script>
<script type="text/javascript" src="/js/backToTop.js"></script>
<script type="text/javascript">
$(function(){
	$("#head_menu").headmenu(1);
	$('#headSearch').selectbox();
	$("#allsort").Prolist();
	$(".index_snapup").Prolist();
	$("#proSort").Prolist();
	$("#index_news").TabADS();
	$('.index_prom .cont_l img').LoadImage(true,120,120);
	$('.index_prom .cont_c img').LoadImage(true,205,300);
	$('.index_snapup img').LoadImage(true,140,140);
	$('.pro_sort .pro_li img').LoadImage(true,158,158);
});
//删除购物车商品
function deletesCart(rowid){                   
    $.ajax({
        type:"POST",
        url: "<?php echo Yii::app()->createUrl('/ajax/AjaxDelCart/') ?>",
        data:"rowid="+rowid,
        success: function(msg){
            //alert(msg);
            //$mycart = msg;
           $('#cart-form').html(msg);
        }
    })
	
	$.ajax({
		type:"POST",
		url: "<?php echo Yii::app()->createUrl('/ajax/AjaxCartNum/') ?>",
		dataType: 'html',
		success: function(msg){
			//alert(msg);
		   $('#cart_num').html(msg);
		}
	})
};

window.onload = function cartNum()
{
	$.ajax({
		type:"POST",
		url: "<?php echo Yii::app()->createUrl('/ajax/AjaxCartNum/') ?>",
		success: function(msg){
			//alert(msg);
		   $('#cart_num').html(msg);
		}
	})
};
</script>
</body>
</html>